<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let money = 10000
    while (true) {
      let key = +prompt(`请选择操作:
      1.存钱
      2.取钱
      3.查看余额
      4.退出
      `)
      if (key == 4) {
        break
      }
      switch (key) {
        case 1:
          let num = +prompt('请输入存入金额')
          money = money + num
          break
        case 2:
          let qu = +prompt('请输入取款金额')
          money = money - qu
          break
        case 3:
          alert(money)
          break;
      }
    }
  </script>
</body>

</html>